#include "ResourceManager.h"

ResourceManager* ResourceManager::instance = 0;

ResourceManager::ResourceManager()
{
}

ResourceManager::~ResourceManager()
{
}

ResourceManager* ResourceManager::getInstance(){
	if(instance == 0)
		instance = new ResourceManager;

	return instance;
}

void ResourceManager::loadResource(){
	CCSpriteFrameCache* frameCache = CCSpriteFrameCache::sharedSpriteFrameCache();
	frameCache->addSpriteFramesWithFile(SPRITE_PATH"playScene.plist");

	// animation

	/*char str[100] = {0};

	// YellowPlayerTank_Move
	CCArray* animationArray = CCArray::create();
	for (int i = 0; i<2; i++)
	{
		sprintf(str, "Bird_%d.png", i);
		CCSpriteFrame* spriteFrame = frameCache->spriteFrameByName(str);
		animationArray->addObject(spriteFrame);
	}

	CCAnimation* animation = CCAnimation::createWithSpriteFrames(animationArray, 0.1f);
	CCAnimationCache* animationCache = CCAnimationCache::sharedAnimationCache();
	animationCache->addAnimation(animation, "BirdFly");*/
}

CCSpriteBatchNode* ResourceManager::getSpriteBatchNode(){
	return spriteBatchNode;
}